package cn.wanho.CmsUserThreadLocal;

import cn.wanho.dto.CmsUser;
public class UserThreadLocal {

    //把构造函数私有，外面不能new，只能通过下面两个方法操作
    private UserThreadLocal(){

    }

    private static final ThreadLocal<CmsUser> LOCAL = new ThreadLocal<CmsUser>();

    public static void set(CmsUser user){
        LOCAL.set(user);
    }

    public static CmsUser get(){
        return LOCAL.get();
    }
}

